<?php
/**
 * Created by PhpStorm.
 * User: VJLau
 * Date: 2018/1/30
 * Time: 下午3:12
 */

defined('IN_IA') or exit('Access Denied');

$sql = "

-- -----------------------------------------------------
-- Table `ims_bontrip_dest`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_dest` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_dest` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `sort` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序，越大越前',
  `region_id` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属区域ID',
  `name` VARCHAR(50) NOT NULL COMMENT '目的地名称',
  `thumb` VARCHAR(300) NOT NULL COMMENT '缩略图',
  `thumbs` TEXT NOT NULL COMMENT '多张展示图',
  `single_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '单品数目',
  `oneday_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '一日游数量',
  `quality_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '精品游数量',
  `is_index` TINYINT(1) UNSIGNED NOT NULL COMMENT '是否首页显示',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '目的地';


-- -----------------------------------------------------
-- Table `ims_bontrip_region`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_region` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_region` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `sort` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序，越大越前',
  `name` VARCHAR(50) NOT NULL COMMENT '区域名称',
  `intro` VARCHAR(200) NULL COMMENT '描述',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '目的所属区域';


-- -----------------------------------------------------
-- Table `ims_bontrip_oneday`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_oneday` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_oneday` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `dest_id` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '目的地ID',
  `sort` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序，越大越前',
  `label` VARCHAR(50) NULL COMMENT '标签(如:极光精选)',
  `tag` VARCHAR(50) NOT NULL COMMENT '标签，多个逗号分隔',
  `name` VARCHAR(100) NOT NULL COMMENT '目的地名称',
  `introduction` VARCHAR(200) NULL COMMENT '描述',
  `remark` VARCHAR(200) NOT NULL COMMENT '备注',
  `thumb` VARCHAR(300) NOT NULL COMMENT '缩略图',
  `thumbs` TEXT NOT NULL COMMENT '多张展示图',
  `sku` TEXT NULL COMMENT 'sku扩展参数，序列化保存',
  `currency_id` INT UNSIGNED NOT NULL COMMENT '汇率ID',
  `adult_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人单价',
  `child_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '儿童单价',
  `baby_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '婴儿单价',
  `product_desc` TEXT NULL COMMENT '产品介绍',
  `price_desc` TEXT NULL COMMENT '费用说明',
  `use_desc` TEXT NULL COMMENT '使用说明',
  `buy_desc` TEXT NULL COMMENT '购买须知',
  `is_index` TINYINT(1) UNSIGNED NOT NULL COMMENT '是否首页显示',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '一日游';


-- -----------------------------------------------------
-- Table `ims_bontrip_single`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_single` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_single` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `dest_id` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '目的地ID',
  `sort` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序，越大越前',
  `tag` VARCHAR(50) NOT NULL COMMENT '标签',
  `name` VARCHAR(100) NOT NULL COMMENT '目的地名称',
  `remark` VARCHAR(200) NOT NULL COMMENT '备注',
  `thumb` VARCHAR(300) NOT NULL COMMENT '缩略图',
  `thumbs` TEXT NOT NULL COMMENT '多张展示图',
  `sku` TEXT NULL COMMENT 'sku扩展参数，序列化保存',
  `currency_id` INT UNSIGNED NOT NULL COMMENT '汇率ID',
  `adult_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人单价',
  `child_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '儿童单价',
  `baby_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '婴儿单价',
  `product_desc` TEXT NULL COMMENT '产品介绍',
  `price_desc` TEXT NULL COMMENT '费用说明',
  `use_desc` TEXT NULL COMMENT '使用说明',
  `buy_desc` TEXT NULL COMMENT '购买须知',
  `is_index` TINYINT(1) UNSIGNED NOT NULL COMMENT '是否首页显示',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '单品产品';


-- -----------------------------------------------------
-- Table `ims_bontrip_hotel`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_hotel` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_hotel` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `dest_id` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '目的地ID',
  `thumb` VARCHAR(300) NOT NULL COMMENT '缩略图',
  `thumbs` TEXT NOT NULL COMMENT '多张展示图',
  `name` VARCHAR(100) NOT NULL COMMENT '中文名',
  `ename` VARCHAR(100) NULL COMMENT '英文名',
  `introduction` VARCHAR(1000) NULL COMMENT '简介',
  `longitude` DECIMAL(10,7) UNSIGNED NULL COMMENT '经度',
  `latitude` DECIMAL(10,7) UNSIGNED NULL COMMENT '纬度',
  `addr` VARCHAR(200) NULL COMMENT '地址',
  `star` DECIMAL(10,1) NULL DEFAULT -1 COMMENT '星级，-1代码没有评级',
  `currency_id` INT UNSIGNED NOT NULL COMMENT '汇率ID',
  `price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '单价',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '酒店';


-- -----------------------------------------------------
-- Table `ims_bontrip_currency`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_currency` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_currency` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(50) NOT NULL COMMENT '货币名称',
  `short_name` VARCHAR(50) NOT NULL COMMENT '货币缩写',
  `symbol` VARCHAR(10) NOT NULL COMMENT '符号',
  `exchange_rate` DECIMAL(10,4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '汇率',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '货币表';


-- -----------------------------------------------------
-- Table `ims_bontrip_quality_dest`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_quality_dest` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_quality_dest` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `quality_id` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '精品游ID',
  `dest_id` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '目的地ID',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '目的地线路';


-- -----------------------------------------------------
-- Table `ims_bontrip_quality`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_quality` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_quality` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `sort` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序，越大越前',
  `label` VARCHAR(50) NULL COMMENT '标签(如:极光精选)',
  `tag` VARCHAR(50) NOT NULL COMMENT '标签，多个逗号分隔',
  `name` VARCHAR(100) NOT NULL COMMENT '目的地名称',
  `introduction` VARCHAR(200) NULL COMMENT '描述',
  `remark` VARCHAR(200) NOT NULL COMMENT '备注',
  `thumb` VARCHAR(300) NOT NULL COMMENT '缩略图',
  `thumbs` TEXT NOT NULL COMMENT '多张展示图',
  `sku` TEXT NULL COMMENT 'sku扩展参数，序列化保存',
  `currency_id` INT UNSIGNED NOT NULL COMMENT '汇率ID',
  `adult_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人单价',
  `child_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '儿童单价',
  `baby_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '婴儿单价',
  `product_desc` TEXT NULL COMMENT '产品介绍',
  `price_desc` TEXT NULL COMMENT '费用说明',
  `use_desc` TEXT NULL COMMENT '使用说明',
  `buy_desc` TEXT NULL COMMENT '购买须知',
  `is_index` TINYINT(1) UNSIGNED NOT NULL COMMENT '是否首页显示',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '精品游';


-- -----------------------------------------------------
-- Table `ims_bontrip_member`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_member` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_member` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `openid` VARCHAR(50) NOT NULL COMMENT '用户ID',
  `avatar` VARCHAR(300) NOT NULL COMMENT '微信头像',
  `nick_name` VARCHAR(50) NOT NULL COMMENT '微信昵称',
  `real_name` VARCHAR(50) NOT NULL COMMENT '真实姓名',
  `mobile` VARCHAR(20) NOT NULL COMMENT '手机号码',
  `email` VARCHAR(50) NOT NULL COMMENT '邮箱地址',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `ims_bontrip_auth_code`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_auth_code` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_auth_code` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `mobile` VARCHAR(20) NOT NULL COMMENT '手机号',
  `auth_code` CHAR(4) NOT NULL COMMENT '验证码',
  `access_ip` VARCHAR(15) NOT NULL COMMENT '访问IP',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '手机验证码';


-- -----------------------------------------------------
-- Table `ims_bontrip_single_order`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_single_order` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_single_order` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `member_id` INT UNSIGNED NOT NULL COMMENT '用户ID',
  `single_id` INT UNSIGNED NOT NULL COMMENT '单品ID',
  `tag` VARCHAR(50) NOT NULL COMMENT '标签',
  `name` VARCHAR(100) NOT NULL COMMENT '目的地名称',
  `remark` VARCHAR(200) NOT NULL COMMENT '备注',
  `thumb` VARCHAR(300) NOT NULL COMMENT '缩略图',
  `sku` TEXT NULL COMMENT 'sku扩展参数，序列化保存',
  `departure_date` INT UNSIGNED NOT NULL COMMENT '出发时间',
  `currency_id` INT UNSIGNED NOT NULL COMMENT '汇率ID',
  `exchange_rate` DECIMAL(10,4) UNSIGNED NOT NULL COMMENT '汇率',
  `adult_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人单价',
  `child_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '儿童单价',
  `baby_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '婴儿单价',
  `adult_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人数量',
  `child_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '儿童数量',
  `baby_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '婴儿数量',
  `adult_members` TEXT NULL COMMENT '成人信息，序列化保存',
  `child_members` TEXT NULL COMMENT '儿童信息，序列化保存',
  `baby_members` TEXT NULL COMMENT '婴儿信息，序列化保存',
  `total_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '总价格，元',
  `status` TINYINT(1) UNSIGNED NOT NULL COMMENT '状态,0:未支付,1:已支付',
  `contact_name` VARCHAR(20) NOT NULL COMMENT '联系人姓名',
  `contact_mobile` VARCHAR(20) NOT NULL COMMENT '联系人手机',
  `contact_email` VARCHAR(50) NOT NULL COMMENT '联系人邮箱',
  `order_no` VARCHAR(50) NOT NULL COMMENT '订单号',
  `pay_no` VARCHAR(50) NULL COMMENT '支付单号',
  `payment_time` INT UNSIGNED NULL COMMENT '支付时间',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '单品订单';


-- -----------------------------------------------------
-- Table `ims_bontrip_oneday_order`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_oneday_order` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_oneday_order` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `member_id` INT UNSIGNED NOT NULL COMMENT '用户ID',
  `oneday_id` INT UNSIGNED NOT NULL COMMENT '一日游ID',
  `label` VARCHAR(50) NULL COMMENT '标签(如:极光精选)',
  `tag` VARCHAR(50) NOT NULL COMMENT '标签，多个逗号分隔',
  `name` VARCHAR(100) NOT NULL COMMENT '目的地名称',
  `introduction` VARCHAR(200) NULL COMMENT '描述',
  `remark` VARCHAR(200) NOT NULL COMMENT '备注',
  `thumb` VARCHAR(300) NOT NULL COMMENT '缩略图',
  `sku` TEXT NULL COMMENT 'sku扩展参数，序列化保存',
  `departure_date` INT UNSIGNED NOT NULL COMMENT '出发时间',
  `currency_id` INT UNSIGNED NOT NULL COMMENT '汇率ID',
  `exchange_rate` DECIMAL(10,4) UNSIGNED NOT NULL COMMENT '汇率',
  `adult_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人单价',
  `child_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '儿童单价',
  `baby_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '婴儿单价',
  `adult_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人数量',
  `child_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '儿童数量',
  `baby_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '婴儿数量',
  `adult_members` TEXT NULL COMMENT '成人信息，序列化保存',
  `child_members` TEXT NULL COMMENT '儿童信息，序列化保存',
  `baby_members` TEXT NULL COMMENT '婴儿信息，序列化保存',
  `total_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '总价，元',
  `status` TINYINT(1) UNSIGNED NOT NULL COMMENT '状态,0:未支付,1:已支付',
  `contact_name` VARCHAR(20) NOT NULL COMMENT '联系人姓名',
  `contact_mobile` VARCHAR(20) NOT NULL COMMENT '联系人手机',
  `contact_email` VARCHAR(50) NOT NULL COMMENT '联系人邮箱',
  `order_no` VARCHAR(50) NOT NULL COMMENT '订单号',
  `pay_no` VARCHAR(50) NULL COMMENT '支付单号',
  `payment_time` INT UNSIGNED NULL COMMENT '支付时间',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `ims_bontrip_quality_order`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_quality_order` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_quality_order` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `member_id` INT UNSIGNED NOT NULL COMMENT '用户ID',
  `quality_id` INT UNSIGNED NOT NULL COMMENT '精品游ID',
  `label` VARCHAR(50) NULL COMMENT '标签，如:极光精选',
  `tag` VARCHAR(50) NOT NULL COMMENT '标签，多个逗号分隔',
  `name` VARCHAR(100) NOT NULL COMMENT '目的地名称',
  `introduction` VARCHAR(200) NULL COMMENT '描述',
  `remark` VARCHAR(200) NOT NULL COMMENT '备注',
  `thumb` VARCHAR(300) NOT NULL COMMENT '缩略图',
  `sku` TEXT NULL COMMENT 'sku扩展参数，序列化保存',
  `departure_date` INT UNSIGNED NOT NULL COMMENT '出发时间',
  `currency_id` INT UNSIGNED NOT NULL COMMENT '汇率ID',
  `exchange_rate` DECIMAL(10,4) UNSIGNED NULL COMMENT '汇率',
  `adult_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人单价',
  `child_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '儿童单价',
  `baby_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '婴儿单价',
  `adult_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人数量',
  `child_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '儿童数量',
  `baby_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '婴儿数量',
  `adult_members` TEXT NULL COMMENT '成人信息，序列化保存',
  `child_members` TEXT NULL COMMENT '儿童信息，序列化保存',
  `baby_members` TEXT NULL COMMENT '婴儿信息，序列化保存',
  `total_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '总价，元',
  `status` TINYINT(1) UNSIGNED NOT NULL COMMENT '状态,0:未支付,1:已支付',
  `contact_name` VARCHAR(20) NOT NULL COMMENT '联系人姓名',
  `contact_mobile` VARCHAR(20) NOT NULL COMMENT '联系人手机',
  `contact_email` VARCHAR(50) NOT NULL COMMENT '联系人邮箱',
  `order_no` VARCHAR(50) NOT NULL COMMENT '订单号',
  `pay_no` VARCHAR(50) NULL COMMENT '支付单号',
  `payment_time` INT UNSIGNED NULL COMMENT '支付时间',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `ims_bontrip_sms_log`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_sms_log` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_sms_log` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `mobile` VARCHAR(20) NOT NULL COMMENT '手机号',
  `content` VARCHAR(200) NOT NULL COMMENT '内容',
  `status` TINYINT(1) NOT NULL COMMENT '发送状态:0失败,1成功',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '短信日志';


-- -----------------------------------------------------
-- Table `ims_bontrip_line`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_line` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_line` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `sort` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序，越大越前',
  `label` VARCHAR(50) NULL COMMENT '标签(如:极光精选)',
  `tag` VARCHAR(50) NOT NULL COMMENT '标签，多个逗号分隔',
  `name` VARCHAR(100) NOT NULL COMMENT '目的地名称',
  `introduction` VARCHAR(200) NULL COMMENT '描述',
  `remark` VARCHAR(200) NOT NULL COMMENT '备注',
  `thumb` VARCHAR(300) NOT NULL COMMENT '缩略图',
  `thumbs` TEXT NOT NULL COMMENT '多张展示图',
  `price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '单价',
  `product_desc` TEXT NULL COMMENT '产品介绍',
  `price_desc` TEXT NULL COMMENT '费用说明',
  `buy_desc` TEXT NULL COMMENT '购买须知',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `ims_bontrip_line_hotel`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_line_hotel` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_line_hotel` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `line_id` INT UNSIGNED NOT NULL COMMENT '线路ID',
  `hotel_id` INT UNSIGNED NOT NULL COMMENT '酒店ID',
  PRIMARY KEY (`id`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `ims_bontrip_insurance`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_insurance` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_insurance` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `name` VARCHAR(50) NOT NULL COMMENT '保险名称',
  `security_desc` TEXT NULL COMMENT '权益保障',
  `notice_desc` TEXT NULL COMMENT '投保须知',
  `thumb` VARCHAR(300) NULL COMMENT '缩略图',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '保险类型';


-- -----------------------------------------------------
-- Table `ims_bontrip_insurance_price`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_insurance_price` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_insurance_price` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `insurance_id` INT UNSIGNED NOT NULL COMMENT '保险ID',
  `start_days` INT UNSIGNED NOT NULL COMMENT '开始天数',
  `end_days` INT UNSIGNED NOT NULL COMMENT '结束天数',
  `adult_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人单价',
  `child_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '未成人单价',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '保险价格';


-- -----------------------------------------------------
-- Table `ims_bontrip_insurance_order`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_insurance_order` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_insurance_order` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `member_id` INT UNSIGNED NOT NULL COMMENT '用户ID',
  `insurance_id` INT UNSIGNED NOT NULL COMMENT '保险ID',
  `name` VARCHAR(50) NOT NULL COMMENT '保险名称',
  `security_desc` TEXT NULL COMMENT '权益保障',
  `notice_desc` TEXT NULL COMMENT '投保须知',
  `thumb` VARCHAR(300) NULL COMMENT '缩略图',
  `start_day` INT UNSIGNED NOT NULL COMMENT '开始时间',
  `finish_day` INT UNSIGNED NOT NULL COMMENT '结束时间',
  `adult_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人单价',
  `child_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '儿童单价',
  `adult_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '成人数量',
  `child_number` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '儿童数量',
  `adult_members` TEXT NULL COMMENT '成人信息，序列化保存',
  `child_members` TEXT NULL COMMENT '儿童信息，序列化保存',
  `total_price` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '总价格，元',
  `status` TINYINT(1) UNSIGNED NOT NULL COMMENT '状态,0:未支付,1:已支付',
  `contact_name` VARCHAR(20) NOT NULL COMMENT '联系人姓名',
  `contact_mobile` VARCHAR(20) NOT NULL COMMENT '联系人手机',
  `contact_email` VARCHAR(50) NOT NULL COMMENT '联系人邮箱',
  `order_no` VARCHAR(50) NOT NULL COMMENT '订单号',
  `pay_no` VARCHAR(50) NULL COMMENT '支付单号',
  `payment_time` INT UNSIGNED NULL COMMENT '支付时间',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '订单';


-- -----------------------------------------------------
-- Table `ims_bontrip_insurance_member`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_insurance_member` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_insurance_member` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uniacid` INT UNSIGNED NOT NULL COMMENT '所属帐号',
  `member_id` INT UNSIGNED NOT NULL COMMENT '用户ID',
  `certificate_type` VARCHAR(50) NULL COMMENT '证件类型，1:护照',
  `certificate_no` VARCHAR(50) NULL COMMENT '证件号码',
  `real_name` VARCHAR(50) NULL COMMENT '真实姓名',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '被保人';


-- -----------------------------------------------------
-- Table `ims_bontrip_sku`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ims_bontrip_sku` ;

CREATE TABLE IF NOT EXISTS `ims_bontrip_sku` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(30) NOT NULL COMMENT '名称',
  `created_at` INT UNSIGNED NOT NULL COMMENT '创建时间',
  `updated_at` INT UNSIGNED NOT NULL COMMENT '更新时间',
  `deleted_at` INT UNSIGNED NULL COMMENT '删除时间',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = 'sku表';
";

pdo_query($sql);